Public Class SysStrings
    Public Shared Function isBlank(ByVal s As String) As Boolean
        If Len(Trim(s)) = 0 Then
            Return True
        Else
            Return False
        End If
    End Function

    Public Shared Function ConvertToHtml(ByVal s As String) As String
        'Takes a string with spaces and crlfs and changes them to nbsp and <br>
        Dim sRet As String = s
        'sRet = sRet.Replace(" ", "&nbsp;")
        'sRet = sRet.Replace(vbCrLf, "<br>")
        sRet = sRet.Replace(Chr(10), "<br>")
        Return sRet
    End Function

    Public Shared Function SplitOnString(ByVal sData As String, ByVal sSearch As String) As ArrayList
        'Goes through the passed in string splits it based on the search string,
        'Puts the remainder in the last entry.
        'Counts the number of times sSearch occurs in sData
        Dim i As Integer
        Dim iOldPos As Integer = 0
        Dim iPos As Integer = sData.IndexOf(sSearch)
        Dim sRet As New ArrayList
        Do While iPos > 0
            i = i + 1
            sRet.Add(Mid(sData, iOldPos + 1, iPos - iOldPos))
            iOldPos = iPos + sSearch.Length
            If iPos + sSearch.Length + 1 <= sData.Length Then
                iPos = sData.IndexOf(sSearch, iPos + sSearch.Length + 1)
            Else
                iPos = -1
            End If
        Loop
        'Tack on the end of the string.
        sRet.Add(Mid(sData, iOldPos + 1, sData.Length - iOldPos))
        Return sRet
    End Function


End Class
